/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -04 -29
 * Time: 22:46
 */

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("输入顶点数：");
        int n = input.nextInt();
        double[] x = new double[n];
        double[] y = new double[n];
        System.out.println("请输入凸多边形的各个顶点坐标：");
        for (int i = 0; i < n; i++) {
            x[i] = input.nextDouble();
            y[i] = input.nextDouble();
        }
        double area = 0;
        for (int i = 0; i < n; i++) {
            area += x[i] * y[(i + 1) % n] - x[(i + 1) % n] * y[i];
        }
        area /= 2;
        System.out.println("凸多边形面积：" + Math.abs(area));
    }
}
